function getSelectors(path){
    return path.reverse()
    .filter(element => {
        return element !== document && element !== window;
    })
    .map(element => {
        let selecotr = ''
        if(element.id){
            return `${element.nodeName.toLowerCase()}#${element.id}`
        }else if(element.className && typeof element.className === 'string'){
            return `${element.nodeName.toLowerCase()}.${element.className}`
        }else {
            selecotr = element.nodeName.toLowerCase()
        }
        return selecotr
    }).join(' ')
}

export default function getSelector(path){
    if(Array.isArray(path)){
        return getSelectors(path)
    }
}